package com.yy.micro.demo.magic.provider;


import com.yy.micro.magic.core.provider.impl.TriggerResourceProvider;
import com.yy.micro.magic.ext.domain.filter.DynamicTrigger;

import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

import javax.annotation.PostConstruct;

@Component
public class MagicTriggerResourceProvider extends TriggerResourceProvider {

    @Override
    @PostConstruct
    public void init() {
        Set<DynamicTrigger> conditions = new HashSet<>();
//        conditions.add(DynamicCondition.create("test","aaaa#dynamic-[\\d+]#name",new String[]{"dddd#dy-[\\d+]#[\\w]*"}));
        conditions.add(DynamicTrigger.create("test","aaaa#gg-[\\d+]#ccc",new String[]{"dddd#jj-[\\d+]#[\\w]+"}));
        conditions.add(DynamicTrigger.create("test","aaaa#gg-[\\d]#magic-[\\d]#from",new String[]{"dddd#mc-[\\d+]#test-[\\d]#[\\w]+"}));
        regist("test",conditions);
    }

}
